<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        body{
            background: url("background.jpg") no-repeat;
        }
        img{
            position: absolute;
            right: 20px;
            top:100px;
        }
    </style>
</head>
<body>
<img src="1%20(1).png" id="pic"/>
</body>
<script>
    var i=1;
    var x=20;
    function f() {
        i++;
        x++;
        if(i==32){
            i=1;
        }
        pic.src="1 ("+i+").png";
        pic.style.right=x+"px";
    }
    setInterval(f,100)
</script>
</html>